BatchValidationTask Class
Exposes functions for executing and scheduling Batch Validation in ArcGIS Data Reviewer for Server. Provides functions for managing Batch Validation jobs and information.
Batch Validation operates in two execution modes: adhoc (immediate); scheduled. Adhoc jobs execute immediately and run once. Scheduled jobs run repeatedly according to a schedule and terminate once BatchValidationParameters/maxNumberOfExecutions has been exceeded or BatchValidationParameters/executionEndDate has passed. See BatchValidationParameters.
Constructor
BatchValidationTask
-
url
Parameters:
-
url
StringThe DataReviewerServer Server Object Extension (SOE) URL.
Item Index
Methods
Events
- onCancelJobExecutionComplete
- onCreateReviewerSessionsComplete
- onDeleteJobComplete
- onDisableJobComplete
- onEditJobComplete
- onEnableJobComplete
- onError
- onExecuteJobComplete
- onGetAdhocJobsListComplete
- onGetJobDetailsComplete
- onGetJobExecutionDetailsComplete
- onGetJobIdsComplete
- onGetLifecycleStatusStringsComplete
- onGetReviewerSessionsComplete
- onGetScheduledJobsListComplete
- onScheduleJobComplete
Methods
cancelJobExecution
-
jobId
Cancels an executing job.
Parameters:
-
jobId
StringJob Id of the batch validation job to cancel.
Returns:
createReviewerSession
()
Deferred
Creates a new Reviewer session. The Reviewer session stores results from check and batch job execution.
Returns:
deleteJob
-
jobId
Deletes an existing scheduled Batch Validation Job.
Parameters:
-
jobId
StringJob Id of the batch validation job to delete.
Returns:
disableJob
-
jobId
Pauses an existing Batch Validation Job's schedule.
Parameters:
-
jobId
StringJob Id of the batch validation job to be disabled.
Returns:
editJob
-
jobId
-
parameters
Edits the schedule, settings and title of an existing Batch Validation Job
Parameters:
-
jobId
StringJobID of the job to edit.
-
parameters
BatchValidationParametersParameters to change in an existing batch job.
Returns:
enableJob
-
jobId
Restarts an existing Batch Validation Job's schedule. Use enableJob to restart a previously disabled job.
Parameters:
-
jobId
StringJob Id of the batch validation job to enable.
Returns:
executeJob
-
parameters
Executes an adhoc job. Adhoc jobs execute immediately and run once.
Parameters:
-
parameters
BatchValidationParametersParameters specifying the details of a job to execute.
Returns:
getAdhocJobsList
()
Deferred
Retrieves all adhoc jobs from the server and returns an array of BatchValidationJobDetails with the information.
Returns:
getJobDetails
-
jobId
Fetches Batch Validation Job details.
Parameters:
-
jobId
StringJob Id of the batch validation job.
Returns:
getJobExecutionDetails
-
jobId
Fetches the Job Execution details of a Batch Validation Job.
Parameters:
-
jobId
StringJob Id of the batch validation job.
Returns:
getJobIds
()
Deferred
Returns an object that contains Scheduled and AdhocJob IDs in two separate arrays.
Returns:
getLifecycleStatusStrings
()
Deferred
Retrieves a list of localized life cycle status strings from the Reviewer workspace. Each Reviewer result stored in the Reviewer workspace has a life cycle status code that matches one of the strings returned from this method execution. Use these strings to replace the numeric code values when displaying a list of Reviewer results to the user.
Returns:
getReviewerSessions
()
Deferred
Returns an array of sessions in a Reviewer workspace. Access the array through either the deferred object or the onGetReviewerSessionsComplete event.
Returns:
Example:
var url="http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/";
var dashboardTask=new DashboardTask(url);
var deferred=dashboardTask.getReviewerSessions();
deferred.then(function(response)
{
array.forEach(response.reviewerSessions, function(item,i)
{
document.write("Session name: " + item.sessionName);
document.write("<br/>Session Id: " + item.sessionId);
document.write("<br/>User name: " + item.userName);
document.write("<br/>Version name: " + item.versionName);
document.write("<br/>");
});
},
function(error)
{
document.write("Error occurred: " + error.message);
}
);
getScheduledJobsList
()
Deferred
Retrieves all scheduled jobs from the server and returns an array of BatchValidationJobDetails with the information.
Returns:
scheduleJob
-
parameters
Schedules a new Batch Validation.
Parameters:
-
parameters
BatchValidationParametersParameters for scheduling a batch job.
Returns:
Events
onCancelJobExecutionComplete
Dispatched by cancelJobExecution.
onCreateReviewerSessionsComplete
Dispatched by createReviewerSession.
Event Payload:
-
response
Object
Contains:
onDeleteJobComplete
Dispatched by deleteJob.
onDisableJobComplete
Dispatched by disableJob.
onEnableJobComplete
Dispatched by enableJob.
onError
Event Payload:
-
error
Error
Example:
// connect to the onError event of the task
function onErrorHandler(error)
{
alert ("An error occurred. Error message = " +
error.message +" Error code = " +error.code);
}
onExecuteJobComplete
Dispatched by executeJob.
onGetAdhocJobsListComplete
Dispatched by getAdhocJobsList.
onGetJobDetailsComplete
Dispatched by getJobDetails.
Event Payload:
-
response
Object
Contains:- Instance of BatchValidationJobDetails jobDetails
onGetJobExecutionDetailsComplete
Dispatched by getJobExecutionDetails.
Event Payload:
-
response
Object
Contains:- Instance of BatchValidationJobExecutionDetails jobExecutionDetails
onGetJobIdsComplete
Dispatched by getJobIds.
onGetLifecycleStatusStringsComplete
Dispatched by getLifecycleStatusStrings.
onGetReviewerSessionsComplete
Dispatched by getReviewerSessions.
Event Payload:
-
response
Object
Contains:
onGetScheduledJobsListComplete
Dispatched by getScheduledJobsList.
onScheduleJobComplete
Dispatched by scheduleJob.